<template>
  <div style="width: 100%">
    <el-table v-loading="loading" :data="infoList">
      <el-table-column type="index" width="55" align="center" label="序号" />
      <el-table-column label="上次处置日期" align="center" prop="handelTime" />
      <el-table-column label="提醒类型" align="center" prop="noticeType" />
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="handleInfo(scope.row)"
            >前往处置</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>

  <!--<pagination
    v-show="total>0"
    :total="total"
    :page.sync="queryParams.pageNum"
    :limit.sync="queryParams.pageSize"
    @pagination="getList"
  />
--></template>

<script>
import { wasteManage } from "@/api/zhangping/zpMedicalTodo";
import {
  addWasteManage,
  getWasteManage,
  updateWasteManage,
} from "@/api/zhangping/zpMedicalWasteManage";
export default {
  name: "hsglTable",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 一企一档表格数据
      infoList: [],
      // 查询参数
      queryParams: {},
      // 表单参数
      detailForm: {},
      isEdit: false,
      editVisible: false,
    };
  },
  /*props: {
    editVisible: {
      type: Boolean,
      default: () => {
        return false
      }
    }
  },
  watch:{

  },
  computed: {
    show: {
      get () {
        return this.editVisible
      },
      set (val) {
        this.$emit('update:editVisible', val)
      }
    },
  },*/
  created() {
    this.getList();
  },
  methods: {
    getList() {
      this.loading = true;
      wasteManage().then((resp) => {
        this.infoList = resp.data;
        this.loading = false;
      });
    },
    handleInfo(row) {
      const id = row.id || this.ids;
      getWasteManage(id).then((response) => {
        this.detailForm = response.data.wasteManage;
        this.isEdit = true;
        this.editVisible = true;
      });
    },
    /** 提交按钮 */
    submitForm(form, id) {
      if (id != null) {
        updateWasteManage(form).then((response) => {
          this.$modal.msgSuccess("修改成功");
          this.editVisible = false;
          this.getList();
        });
      } else {
        addWasteManage(form).then((response) => {
          this.$modal.msgSuccess("新增成功");
          this.editVisible = false;
          this.getList();
        });
      }
    },
  },
};
</script>

<style></style>
